	function Report() {
		
		this.status = null;
		this.userID;
	
		this.getXMLHttpRequest = function(){
			var request;
			try {
	            request= new XMLHttpRequest();
	        } catch(err1) {
	            try {
	            	request = new ActiveXObject('Msxml2.XMLHTTP');
	            } catch(err2) {
	                try {
	                	request = new ActiveXObject('Microsoft.XMLHTTP');
	                } catch(err3) {
	                	request = false;
	                }
	            }
	        }
	        $.extend(request, { targetObject: null });
	        return request;
	    };
    
    
	    this.processResponse = function(){
	        if(this.readyState==4){
	            if(this.status==200){
	            	this.targetObject.text(this.responseText);
	            };
	        }
	    };
    
   
	    this.sendToAll = function(param){
	    	
	    	var r = this.getXMLHttpRequest();
	    	
	        this.status = $('#info');
	        this.userID = $('#userID').val();
	       
	        r.open("GET", "SendToGenerateForAllAutomatsServlet?userID="+this.userID+"&type="+param, true);     
	        r.targetObject = this.status;
	        r.onreadystatechange = this.processResponse;
	        r.send(null);
	    };
	    
	    this.sendToEmpties = function(param){
	    	
	    	var r = this.getXMLHttpRequest();
	    	
	    	this.status = $('#info2');
	        this.userID=$('#userID').val();
	        
	        r.open("GET", "SendToGenerateForEmptiesAutomatsServlet?userID="+this.userID+"&type="+param, true);   
	        r.targetObject = this.status;
	        r.onreadystatechange = this.processResponse;
	        r.send(null);
	    };
	    
	    this.sendToSelected= function(param){
	    	
	    	var r = this.getXMLHttpRequest();
	    	
	    	this.status = $('#info3');
	        this.userID=$('#userID').val();
	        this.machineID=$('#machineID').val();
	     
	        r.open("GET", "SendToGenerateForSelectedAutomatServlet?userID="+this.userID+"&machineID="+this.machineID+"&type="+param, true);   
	        r.targetObject = this.status;
	        r.onreadystatechange = this.processResponse;
	        r.send(null);
	    };
	
	    this.readPDF = function(param){
	    	
	    	var r = this.getXMLHttpRequest();
	    	if(param=='all'){
	    		this.status = $('#info');
	    	}else if(param=='empty'){
	    		this.status = $('#info2');	
	    	}else if(param=='selected'){
	    		this.status=$('#info3');
	    	}
	        this.userID = $('#userID').val();
	        
	        r.open("GET", "SendToReadPdf?userID="+this.userID+"&type="+param, true);  
	        r.targetObject = this.status;
	        r.onreadystatechange = this.processResponse;
	        r.send(null);
	    };
    
	    this.getCreationDate = function(param){
	    		    	
	    	var r = this.getXMLHttpRequest();
	    	
	    	if(param == "all") {
	    		this.status = $('#creationDateAll');
	    	} else if( param == "empty") {
	    		this.status = $('#creationDateEmpties');
	    	} else if(param== "selected"){
	    		this.status = $('#creationDateSelected');
	    	}
	    		    	
	    	this.userID = $('#userID').val();
	        r.open("GET", "SendToGetCreationDate?userID="+this.userID+"&type="+param, true);    
	        r.targetObject = this.status;
	        r.onreadystatechange = this.processResponse;
	        r.send(null);
	    };
	}
	
   // var refresh = setInterval(function (){getCreationDate();}, 1000);

   